DROP TABLE IF EXISTS jms_ods.yl_tms_branch_shipment;
CREATE EXTERNAL TABLE jms_ods.yl_tms_branch_shipment(
 ID bigint comment "主键",  --NUMBER(11)
 SHIPMENT_NO string comment "任务单号",  --NVARCHAR2(15)
 BRANCH_LINE_ID bigint comment "支线id",  --NUMBER(11)
 BRANCH_LINE_CODE string comment "支线编码",  --NVARCHAR2(30)
 BRANCH_LINE_NAME string comment "支线名称",  --NVARCHAR2(100)
 START_NETWORK_ID bigint comment "发车网点id",  --NUMBER(11)
 START_NETWORK_CODE string comment "发车网点编号",  --NVARCHAR2(20)
 START_NETWORK_NAME string comment "发车网点名称",  --NVARCHAR2(50)
 START_FINANCIAL_CENTER_ID bigint comment "发车网点所属财务中心ID",  --NUMBER(11)
 START_FINANCIAL_CENTER_CODE string comment "发车网点所属财务中心code",  --NVARCHAR2(30)
 START_FINANCIAL_CENTER_DESC string comment "发车网点所属财务中心名称",  --NVARCHAR2(60)
 START_PARENT_NETWORK_ID bigint comment "发车网点所属网点ID",  --NUMBER(11)
 START_PARENT_NETWORK_CODE string comment "发车网点所属网点编码",  --NVARCHAR2(30)
 START_PARENT_NETWORK_NAME string comment "发车网点所属网点名称",  --NVARCHAR2(50)
 START_REGIONAL_ID bigint comment "发车网点所属大区ID",  --NUMBER(11)
 START_REGIONAL_DESC string comment "发车网点所属大区名称",  --NVARCHAR2(50)
 PLANNED_DEPARTURE_TIME timestamp comment "计划发车时间",  --DATE
 ACTUAL_DEPARTURE_TIME timestamp comment "实际发车时间",  --DATE
 LOAD_TIME timestamp comment "装车时间",  --DATE
 LOCK_TIME timestamp comment "锁车时间",  --DATE
 END_NETWORK_ID bigint comment "到车网点id",  --NUMBER(11)
 END_NETWORK_CODE string comment "到车网点编号",  --NVARCHAR2(20)
 END_NETWORK_NAME string comment "到车网点名称",  --NVARCHAR2(50)
 END_FINANCIAL_CENTER_ID bigint comment "到车网点所属财务中心ID",  --NUMBER(11)
 END_FINANCIAL_CENTER_CODE string comment "到车网点所属财务中心code",  --NVARCHAR2(30)
 END_FINANCIAL_CENTER_DESC string comment "到车网点所属财务中心名称",  --NVARCHAR2(60)
 END_PARENT_NETWORK_ID bigint comment "到车网点所属网点ID",  --NUMBER(11)
 END_PARENT_NETWORK_CODE string comment "到车网点所属网点编码",  --NVARCHAR2(30)
 END_PARENT_NETWORK_NAME string comment "到车网点所属网点名称",  --NVARCHAR2(50)
 END_REGIONAL_ID bigint comment "到车网点所属大区ID",  --NUMBER(11)
 END_REGIONAL_DESC string comment "到车网点所属大区名称",  --NVARCHAR2(50)
 USETIME bigint comment "运输耗时(min)",  --NUMBER(11)
 PLANNED_ARRIVAL_TIME timestamp comment "计划到车时间",  --DATE
 ACTUAL_ARRIVAL_TIME timestamp comment "实际到车时间",  --DATE
 CLOCK_TIME timestamp comment "中心打卡时间",  --DATE
 UNLOCK_TIME timestamp comment "解锁时间",  --DATE
 UNLOAD_TIME timestamp comment "卸车时间",  --DATE
 EXPECTED_ARRIVAL_TIME timestamp comment "预计到达时间"  --DATE
 )
 COMMENT '支线任务表'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_tms_branch_shipment'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_tms_branch_shipment;